<div class="left">
    <h2 class="titles"><?php __('问答频道'); ?></h2>
	<ul class='question-nav'>
		<li><?php echo $html->link('最近更新的问题', '/questions/') ?></li>
		<li><?php echo $html->link('待解决', '/questions/unsolved') ?></li>
		<li><?php echo $html->link('已解决', '/questions/solved') ?></li>
	</ul>
    <table class="post-list" cellpadding="0" cellspacing="0">
        <tr>
            <td>提问者</td>
            <td>问题标题</td>
            <td>回答数</td>
            <td>所属语种</td>
            <td>状态</td>
        </tr>
        <?php
        foreach ($questions as $question):
        ?>
            <tr >
                <td>
                <?php echo $this->Avatar->userLink($question['User']); ?><br>
                <?php echo $linker->userLink($question['User']) ?>
            </td>
            <td><?php echo $this->Html->link($question['Question']['title'], array('action' => 'view', $question['Question']['id'])); ?> <br>
                <?php echo $text->truncate($question['Question']['body'], 40, array('html' => false)) ?>
                &nbsp;</td>

            <td><?php echo sizeof($question['Answer']) ?></td>
            <td><?php echo $question['Language']['name'] ?></td>
            <td><?php echo Question::status($question); ?>&nbsp;</td>
        </tr>
        <?php endforeach; ?>
            </table>
            <p>
        <?php
                echo $this->Paginator->counter(array(
                    'format' => __('第 %page% 页，共 %pages% 页, 当前显示 %current% ／ %count% 项, 从 %start% 到 %end%', true)
                ));
        ?>	</p>

            <div class="paging">
        <?php echo $this->Paginator->prev('<< ' . __('前页', true), array(), null, array('class' => 'disabled')); ?>
                        	 | 	<?php echo $this->Paginator->numbers(); ?>
                |
        <?php echo $this->Paginator->next(__('后页', true) . ' >>', array(), null, array('class' => 'disabled')); ?>
            </div>
        </div>
        <div class="right">
            <p><?php echo $this->Html->link(__('我要提问', true), array('action' => 'add'), array('class' => 'btn')); ?></p>
            <div class="sub-titles"><?php __('搜索职位'); ?></div>
            <div class="search-box">
        <?php echo $form->create(null, array('type' => 'GET', 'url' => '/questions/search')) ?>
                <table >
                    <tr><td>关键字：</td><td><?php echo $form->text('q', array('class' => 'full-width')) ?></td></tr>
                    <tr><td>语种：</td><td>
                            <select name="lan" id="lan" size="1">
                                <option value=''>语种</option>
                        <?php foreach ($languages as $language): ?>
                            <option value="<?php echo $language['Language']['id'] ?>"><?php echo $language['Language']['name'] ?></option>
                        <?php endforeach ?>
                        </select>
                    </td>
                <tr><td></td><td><?php echo $form->end('搜索') ?>
        </table>
    </div>
</div>